package com.db.login;

import java.io.Reader;
import java.sql.SQLException;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class LoginManager {
	private static SqlMapClient sqlmap;
	static {
		try {
			Reader reader = Resources
					.getResourceAsReader("com/db/config/SqlMapConfig.xml");
			sqlmap = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	
	public static int checkMemno (int memno) throws SQLException{
		return (Integer) sqlmap.queryForObject("checkMemno", memno);
	}
	
	public static int checkPwd(LoginVO vo) throws SQLException{
		return (Integer) sqlmap.queryForObject("checkPwd", vo);
	}
	
}
